<!--
 * @Descripttion: 
 * @LastEditors: xzh
 * @LastEditTime: 2023-11-21 21:57:44
-->
<template>
  <DileLayer
    v-model="chartLayerParam.visible"
    :layerWidth="700"
    :layerHeight="600"
    :footerVisible="false"
    :title="`${
      chartLayerParam?.equipInfo?.equipmentName ||
      $t(
        `page.dashboardManageArr.produceDashboard.outputCountArr.${chartLayerParam.dataType}`
      )
    }-${$t(`common.chartArr.trendChart`)}`"
  >
    <!-- 推移图 -->
    <TrendChart ref="trendChartRef" />
  </DileLayer>
</template>

<script setup lang="ts">
import { object_Inf } from "@/utils/typings/index.type";
import { ref, reactive, nextTick } from "vue";
import TrendChart from "../index.vue";

let defaultData = () => ({
  visible: false,
  dataType: "",
  equipInfo: {},
});

/**
 * @Author: xzh
 * @Descripttion: 推移图实例
 * @Param:
 */
let trendChartRef = ref<any>(null);

/**
 * @Author: xzh
 * @Descripttion: 推移图弹框参数
 * @Param:
 */
let chartLayerParam = reactive<object_Inf>(defaultData());
/**
 * @Author: xzh
 * @Descripttion: 初始化
 * @Param:
 */
let init = async (param: object_Inf) => {
  Object.assign(chartLayerParam, defaultData(), {
    visible: true,
    ...param,
  });
  await nextTick();
  //加载图表信息
  await trendChartRef.value.init(param);
};

defineExpose({
  init,
});
</script>
<style lang="scss" scoped></style>
